<template>
    <div class="lis-comp">
        <Row>
            <Col span="1"></Col>
            <Col span="3">已完成 ({{ok_list_cnt}}条) </Col>
            <Col span="3"></Col>
        </Row>
        <div class="lisis_tab">
            <Table border ref="selection" :columns="columns" :data="data"></Table>
        </div>
    </div>
</template>
<style>
    .lisis_tab{margin-top:10px;}
    .lis-comp{margin-top:30px;}
</style>
<script>
    export default {
        props: ['cid'],
        data () {
            return {
                columns: [
                    {
                        type: 'selection',
                        width: 60,
                        align: 'center'
                    },
                    {
                        title: '安排时间/人',
                        key: 'name'
                    },
                    {
                        title: '创建时间/人',
                        key: 'create_name'
                    },
                    {
                        title: '联系人',
                        key: 'liaison_name'
                    },
                    {
                        title: '联系方式',
                        key: 'contact_type'
                    },
                    {
                        title: '阶段',
                        key: 'follow_stage'
                    },
                    {
                        title: '备注',
                        key: 'remarks'
                    },
                    {
                        title: '操作',
                        key: 'address'
                    }
                ],
                data: [],
                ok_list_cnt: 0
            }
        },
        methods: {
            handleSelectAll (status) {
                this.$refs.selection.selectAll(status);
            },
            get_ok_list(cid) {
                this.$http.get('http://jorren-api.iccchina.com/company/companys_follow_log/get_liaison_nook_list',{params:{cid: cid, state: 2}
                })
                .then(data => {
                    this.data = data.data.list
                    this.ok_list_cnt = data.data.cnt
                })
            }
        },
        mounted() {
            let cid = this.$route.query.cid;
            this.get_ok_list(cid);
        }
    }
</script>
